package com.sc.nft.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.dto.*;
import com.sc.nft.entity.vo.ArticleDetailsVO;
import com.sc.nft.entity.vo.DaoSchoolArticlePageAdminVO;
import com.sc.nft.entity.vo.DaoSchoolTopHomeArticleListVO;
import com.sc.nft.sup.PageRequest;

import java.util.List;

/**
 * 文章表(DaoSchoolArticle)表服务接口
 *
 * @author makejava
 * @since 2023-03-13 16:20:42
 */
public interface DaoSchoolArticleService {

    /**
     * 后台获取分页列表
     *
     * @param pageRequest
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> pageAdmin(PageRequest pageRequest);

    /**
     * 删除文章
     *
     * @param id
     * @return
     */
    Boolean deleteById(Long id);

    /**
     * 新增文章
     *
     * @param daoSchoolArticleSaveAdminDTO
     * @return
     */
    Boolean saveAdmin(DaoSchoolArticleSaveAdminDTO daoSchoolArticleSaveAdminDTO);

    /**
     * 修改文章
     *
     * @param daoSchoolArticleUpdateByIdAdminDTO
     * @return
     */
    Boolean updateById(DaoSchoolArticleUpdateByIdAdminDTO daoSchoolArticleUpdateByIdAdminDTO);

    /**
     * 获取没有被某个子集选中的文章
     *
     * @param daoSchoolArticleNotChildIdPageListDTO
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> selectByNotChildIdPageList(DaoSchoolArticleNotChildIdPageListDTO daoSchoolArticleNotChildIdPageListDTO);

    /**
     * 获取没有被置顶的文章
     *
     * @param daoSchoolArticleNotChildIdPageListDTO
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> selectByNotTopArticle(DaoSchoolArticleNotChildIdPageListDTO daoSchoolArticleNotChildIdPageListDTO);

    /**
     * 获取首页推荐文章
     *
     * @param daoSchoolArticleNotChildIdPageListDTO
     * @return
     */
    Page<DaoSchoolArticlePageAdminVO> homePageAdmin(DaoSchoolArticleNotChildIdPageListDTO daoSchoolArticleNotChildIdPageListDTO);

    /**
     * 文章置顶
     *
     * @param list
     * @return
     */
    Boolean articleTop(List<DaoSchoolArticleTopDTO> list);

    /**
     * 取消文章置顶
     *
     * @param list
     * @return
     */
    Boolean cancelArticleTop(List<DaoSchoolCancelArticleTopDTO> list);

    /**
     * 获取首页文章
     *
     * @return
     */
    List<DaoSchoolTopHomeArticleListVO> getHomeTopArticle();

    /**
     * 通过id获取文章
     *
     * @param articleId
     * @return
     */
    ArticleDetailsVO byIdGetArticle(Long articleId);


    /**
     * 根据id增加文章浏览次数
     *
     * @param id
     * @param browse
     * @return
     */
    Boolean increaseArticleViewsBasedOnId(Long id, Integer browse);

}
